import request from '@/utils/request'

// 面试技巧
// 获取文章列表
export function getArticleList(params) {
  return request({
    url: '/articles',
    params
  })
}

// 文章删除
export function deleteArticle(id) {
  return request({
    url: `/articles/${id}`,
    method: 'DELETE'
  })
}

// 文章添加
export function addArticle(data) {
  return request({
    url: `/articles`,
    method: 'POST',
    data
  })
}

// 文章修改
export function updateArticle(id, data) {
  return request({
    url: `/articles/${id}`,
    method: 'PUT',
    data
  })
}

// 文章状态
export function updataArtState(id,state) {
  return request({
    url: `/articles/${id}/${state}`,
    method: 'POST'
  })
}

// 查看文章详情
export function queryArticle(id) {
  return request({
    url: `/articles/${id}`
  })
}
